﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;

namespace StevensReceipts.Domain
{
    /// <summary>
    /// chart of Accounts account types
    /// </summary>
    public class ChartofAccountAccountType : IEntity
    {
        public ChartofAccountAccountType()
        {
            Created = DateTime.Now;
        }

        [Key]
        public int Id { get; set; }

        [StringLength(50)]
        public string Name { get; set; }

        [JsonIgnore]
        public virtual TaxRate DefaultTaxRate { get; set; }

        public DateTime? Created { get; set; }

        public DateTime? Modified { get; set; }

        public int CategoryId { get; set; }
        
        [ForeignKey("CategoryId")]
        [JsonIgnore]
        public virtual ChartofAccountCategory ChartofAccountCategory { get; set; }

    }
}